{include file="header" title="YunCMS后台管理系统" keywords="" description=""/}
<form action="" class="am-form am-g margin-top-buttom-20" data-am-validator="" method="post">
    <div class="all-width-six">
        <table class="model-table">
            <thead>
            <tr>
                <th>名称</th>
                <th>字段英文标识</th>
                <th>字段类型</th>
                <!--<th>字段选项值</th>-->
                <th>操作</th>
            </tr>
            </thead>
            {volist name='model_attr' id='model_attr'}
            <tr>
                <td>{$model_attr.pro_name}</td>
                <td>{$model_attr.pro_key}</td>
                <td>{$model_attr.type}</td>
                <!--<td>{$model_attr.pro_value}</td>-->
                <td>
                    <a class="model-field-mod" data-type="{$model_attr.type}" data-id="{$model_attr['model_id']}"  data-url="<?=URL('/admin/model/attrupdate')?>"   data-attr-id="{$model_attr['model_properties_id']}">修改</a>
                    <a class="model-field-del"
                       href="<?=URL('/admin/model/attrdelete',array('id'=>$model_attr['model_id'],'attr_id'=>$model_attr['model_properties_id']));?>">删除</a>
                </td>
            </tr>
            {/volist}
        </table>
        <div class="model-table-add" >
            <label>字段类型：</label>
            <div id="model-table-add-1">
                <select data-am-selected name="attr[pro_cate]" class="model-field-type" data-url="<?=URL('/admin/model/get_model_attr');?>" required >
                    <option >请选择字段类型</option>
                    {volist name='attr_config' id='attr_config' }
                    <option value="{$key}">{$attr_config}</option>
                    {/volist}
                </select>
            </div>
            <div class="model-file model-field-type-text">
                <label for="model-field-text-tips">标题（请输入字段标题，长度不超过30）</label>
                <input type="text" name="attr[text][pro_name]" id="model-field-text-tips" maxlength="30" required {notempty name="attr_one"
                       }value="{$attr_one.pro_name}" {/notempty} />
                <label for="model-field-text-name">字段名（请输入字段名 英文字母，长度不超过30）</label>
                <input type="text" class="js-pattern-latter" name="attr[text][pro_key]" id="model-field-text-name" maxlength="30" {notempty name="attr_one"
                       }value="{$attr_one.pro_key}" {/notempty} required />
            </div>

            <div class="model-file model-field-type-file">
                <label for="model-field-file-tips">标题（请输入字段标题，长度不超过30）</label>
                <input type="text" name="attr[file][pro_name]" id="model-field-file-tips" maxlength="30" required {notempty name="attr_one"
                       }value="{$attr_one.pro_name}" {/notempty} />
                <label for="model-field-file-name">字段名（请输入字段名 英文字母，长度不超过30）</label>
                <input type="text" class="js-pattern-latter" name="attr[file][pro_key]" id="model-field-file-name" maxlength="30" {notempty name="attr_one"
                       }value="{$attr_one.pro_key}" {/notempty} required />
            </div>

            <div class="model-file model-field-type-textarea" >
                <label for="model-field-textarea-tips">标题（请输入字段标题，长度不超过30）</label>
                <input type="text" name="attr[textarea][pro_name]" id="model-field-textarea-tips" maxlength="30" required {notempty name="attr_one"
                       }value="{$attr_one.pro_name}" {/notempty} />
                <label for="model-field-textarea-name">字段名（请输入字段名 英文字母，长度不超过30）</label>
                <input type="text" class="js-pattern-latter" name="attr[textarea][pro_key]" id="model-field-textarea-name" maxlength="30" {notempty name="attr_one"
                       }value="{$attr_one.pro_key}" {/notempty} required />
            </div>
            <div class=" model-file model-field-type-select">
                <label for="model-field-select-tips">标题（请输入标题，长度不超过30）</label>
                <input type="text" name="attr[select][pro_name]" id="model-field-select-tips" maxlength="30" required {notempty name="attr_one"
                       }value="{$attr_one.pro_name}" {/notempty} />
                <label for="model-field-select-name">字段名（请输入字段名 英文字母开头，长度不超过30）</label>
                <input type="text" class="js-pattern-latter" name="attr[select][pro_key]" id="model-field-select-name" maxlength="30" required {notempty name="attr_one"
                       }value="{$attr_one.pro_key}" {/notempty} />
                <table class="model-select">
                    <thead>
                    <tr>
                        <th>字段的显示内容（请输入自定义初始值，用于表单显示）</th>
                        <th></th>
                        <th>字段的值（数据表中此字段的值）</th>
                        <th>操作</th>
                    </tr>
                    </thead>

                </table>
                <div class=" am-icon-plus-square am-icon-lg model-field-add-button model-add"></div>
            </div>
            <div class=" model-file model-field-type-radio">
                <label for="model-field-radio-tips">标题（请输入标题，长度不超过30）</label>
                <input type="text"  name="attr[radio][pro_name]" id="model-field-radio-tips" maxlength="30" required {notempty name="attr_one"
                       }value="{$attr_one.pro_name}" {/notempty} />
                <label for="model-field-radio-name">字段名（请输入字段名 英文字母开头，长度不超过30）</label>
                <input type="text" class="js-pattern-latter"  name="attr[radio][pro_key]" id="model-field-radio-name" maxlength="30" required {notempty name="attr_one"
                       }value="{$attr_one.pro_key}" {/notempty} />
                <table class="model-select">
                    <thead>
                    <tr>
                        <th></th>
                        <th>字段的显示内容（请输入自定义初始值，用于表单显示）</th>
                        <th></th>
                        <th>字段的值（数据表中此字段的值）</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                </table>
                <div class=" am-icon-plus-square am-icon-lg model-field-add-button model-add"></div>
            </div>
            <div class=" model-file model-field-type-checkbox">
                <label for="model-field-checkbox-tips">标题（请输入标题，长度不超过30）</label>
                <input type="text" name="attr[checkbox][pro_name]" id="model-field-checkbox-tips" maxlength="30" required {notempty name="attr_one"
                       }value="{$attr_one.pro_name}" {/notempty} />
                <label for="model-field-checkbox-name">字段名（请输入字段名 英文字母开头，长度不超过30）</label>
                <input type="text" class="js-pattern-latter" name="attr[checkbox][pro_key]" id="model-field-checkbox-name" maxlength="30" required {notempty name="attr_one"
                       }value="{$attr_one.pro_key}" {/notempty} />
                <table class="model-select">
                    <thead>
                    <tr>
                        <th></th>
                        <th>字段的显示内容（请输入自定义初始值，用于表单显示）</th>
                        <th></th>
                        <th>字段的值（数据表中此字段的值）</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                </table>
                <div class=" am-icon-plus-square am-icon-lg model-field-add-button model-add"></div>
            </div>
            <input type="hidden" name="attr_id" id="attr_id" value="{notempty name="attr_one"}{$attr_one.model_properties_id}{/notempty}">
            {notempty name="model_id"}<input type="hidden" name="id" value="{$model_id}">{/notempty}
            <button class="am-btn am-btn-primary button-text-left">提交</button>
            <a href="<?=URL('/admin/model/index');?>" class="am-btn am-btn-primary button-text-left">取消</a>
        </div>
        <div class="am-icon-plus-square am-icon-lg model-table-button"><span>新增字段</span></div>
    </div>
</form>
{include file="footer" /}
